import { Injectable } from '@angular/core';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';

import {DialogOverviewCommonComponent} from './dialogOverviewCommon.component';

@Injectable()
export class DialogOverviewCommonService {
  openDialog(dialog:MatDialog,result:String,error:String): void {
    let dialogRef = dialog.open(DialogOverviewCommonComponent, {
      width: '250px',
      data: { result: result,error:error }
    });

    dialogRef.afterClosed().subscribe(result => {
      console.log('The dialog was closed');
    });
  }
}
